package es.mahulo.battleship.mocks;

import java.util.List;

import es.mahulo.battleship.api.dao.GameDao;
import es.mahulo.battleship.model.Game;
import es.mahulo.battleship.model.User;

public class GameDaoMock implements GameDao {
	
	private Game game;
	
	public GameDaoMock() {
		
	}
	

	@Override
	public Game find(Long id) {
		return game;
	}

	@Override
	public Game create(Game game) {
		this.game = game;
 
		return game;
	}

	@Override
	public Game update(Game game) {
		this.game = game;
		
		try {
			game.getPlayers().get(0).setId(1L);
			game.getPlayers().get(1).setId(2L);
		} catch (Exception e) {
			
		}
		
		return game;
	}



	@Override
	public List<Game> getAllFromUser(User user) {
		// TODO Auto-generated method stub
		return null;
	}

}
